var nodemailer = require('nodemailer');

module.exports.sendMail = async function (data) {
    //发送邮件
    var transporter = nodemailer.createTransport({
        service: 'qq',
        auth: {
            user: '1174308565@qq.com',
            pass: 'aupnhwcakqvngbec' //授权码,通过QQ获取

            //fsfgtqebktekhdbe
            //aupnhwcakqvngbec
            //grypvfniihzygda

        }
    });

    var mailOptions = {
        from: '1174308565@qq.com', // 发送者
        to: 'ycb0318html@163.com,hjy0916html@163.com', // 接受者,可以同时发送多个,以逗号隔开
        subject: '你的小宝贝又发了一篇日志了，快去Couple查看吧（^_^）', // 标题
        //text: 'Hello world', // 文本
        html: '<span>'+data.content+'</span>'
    };

    transporter.sendMail(mailOptions, function (err, info) {
        if (err) {
            console.log(err);
            return;
        }

        //console.log('发送成功',data);
    });
    // console.log('send-success')

}